package com.rdzn.mall.base.common;

/**
 * 枚举了一些常用API操作码
 *
 * @author dingzg
 * @date 2019/4/19
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(0, "操作成功"),
    FAILED(-1, "操作失败"),
    NO_DATA(-2, "未查到相关数据"),
    VALIDATE_FAILED(1001, "参数检验失败"),
    BUSINESS_ERROR_PARAM(1002, "参数异常"),
    BUSINESS_ERROR(2001, "业务校验失败"),
    BUSINESS_ERROR_NO_ORDER(2002, "未知订单"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    SC_INTERNAL_SERVER_ERROR_500(500, "系统异常");
    private int code;
    private String message;

    private ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }
    @Override
    public String getMessage() {
        return message;
    }
}
